package com.bosssoft.g4.controller;

import com.bosssoft.common.result.Result;
import com.bosssoft.g4.entity.Role;
import com.bosssoft.g4.service.RoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: RoleController
 * 角色管理
 * @author: zbh
 * @date: 2024/8/8 10:53
 */
@RestController
@RequestMapping("/api/v1/permission/role")
@Slf4j
@Api(tags = "角色管理相关接口")
public class RoleController {
    @Autowired
    private RoleService roleService;
    /**
     * 新增角色
     * @param role
     */
    @PostMapping
    @ApiOperation("新增角色")
    public Result add(@RequestBody Role role){
        roleService.add(role);
        return Result.success(role);
    }
}
